package com.zz.parkingsystem.entity;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 订单表
 * @TableName t_order
 */
@Data
public class Order implements Serializable {
    /**
     * 订单ID
     */
    private Integer orderId;

    /**
     * 订单项id
     */
    private Integer oiId;

    /**
     * 支付方式
     */
    private Integer ptId;

    /**
     * 进行中,unpaid,paid,申诉中,已退款
     */
    private Integer orderStatus;

    /**
     * 支付时间
     */
    private Date payingTime;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Order other = (Order) that;
        return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getOiId() == null ? other.getOiId() == null : this.getOiId().equals(other.getOiId()))
            && (this.getPtId() == null ? other.getPtId() == null : this.getPtId().equals(other.getPtId()))
            && (this.getOrderStatus() == null ? other.getOrderStatus() == null : this.getOrderStatus().equals(other.getOrderStatus()))
            && (this.getPayingTime() == null ? other.getPayingTime() == null : this.getPayingTime().equals(other.getPayingTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getOiId() == null) ? 0 : getOiId().hashCode());
        result = prime * result + ((getPtId() == null) ? 0 : getPtId().hashCode());
        result = prime * result + ((getOrderStatus() == null) ? 0 : getOrderStatus().hashCode());
        result = prime * result + ((getPayingTime() == null) ? 0 : getPayingTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", orderId=").append(orderId);
        sb.append(", oiId=").append(oiId);
        sb.append(", ptId=").append(ptId);
        sb.append(", orderStatus=").append(orderStatus);
        sb.append(", payingTime=").append(payingTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}